﻿$(document).on("pageInit", "#stu-eva-list", function (e, id, page) {
    loadList();

    function loadList() {
        $(page).find("#list").empty();
        $.getJSON("/Evaluate/GetAllEvalute4Teacher", {}, function (response) {
            $.each(response, function (index, item) {
                var frame = $('<div class="card">\
                                <div class="card-header">' + item.ClazzName + "-" + item.StuRealName + ' 同学[学号：' + item.StuNo + ']</div>\
                                <div class="card-content">\
                                  <div class="card-content-inner">'+item.Remark+'</div>\
                                </div>\
                                </div>\
                              </div>');
                $(page).find("#list").append(frame);

                //<div class="card-footer">\
                //                    <div class="row">\
                //                      <div class="col-50"><a href="#" class="button button-small button-fill button-danger">删除</a></div>\
                //                      <div class="col-50"><a href="#" class="button button-small button-fill button-success">修改</a></div>\
                //                   </div>\
            });
        });
    }
    $(page).find("#menu-btn").on("click", function () {
        var buttons1 = [
        {
            text: '请选择',
            label: true
        },
        {
            text: '新增评教',
            bold: true,
            onClick: function () {
                $.router.load('/Evaluate/Create4Student', true);
            }
        }];

        var buttons2 = [
          {
              text: '取消',
              bg: 'danger'
          }
        ];
        var groups = [buttons1, buttons2];
        $.actions(groups);
    });
});